﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LastoRevival.Service.Contracts.Models
{
	public class CreateUserAttemptResult
	{

		public CreateUserResult Result { get; private set; }
		public UserVerificationType VerificationType { get; private set; }

		public int NewUserID { get; private set; }

		protected CreateUserAttemptResult()
		{
			// wcf constructor
		}

		public CreateUserAttemptResult(int userID, UserVerificationType verificationType)
		{
			// if we have a userId, we were successfull
			this.Result = CreateUserResult.Success;
			this.NewUserID = userID;
			this.VerificationType = verificationType;
		}

		public CreateUserAttemptResult(CreateUserResult failedReason)
		{
			// can't say it's successful here because we'd have no userid
			if (failedReason == CreateUserResult.Success)
			{
				throw new NotSupportedException("UserID must be passed if create was successful");
			}

			this.Result = failedReason;
		}

	}
}
